Let xstrdup clone null strings into empty strings.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 1 Nov 2004 17:37:16 +0000 (17:37 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Mon, 1 Nov 2004 17:37:16 +0000 (17:37 +0000)
gpsbabel/util.c

index 975b7598fe83f955844d98c45086cc34c173aac1..c58520ac068f5a5e00ee013eda4fc25808f740b8 100644 (file)
@@ -121,7 +121,7 @@ XSTRDUP(const char *s, DEBUG_PARAMS )
 xstrdup(const char *s)
 #endif
 {
-       char *o = strdup(s);
+       char *o = s ? strdup(s) : strdup("");
 #ifdef DEBUG_MEM
        debug_mem_output( "strdup, %x, %x, %s, %d\n", 
                        o, s, file, line );